import java.sql.SQLException;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidPooledConnection;

public class CgnbDataSource extends DruidDataSource {

	private static final long serialVersionUID = 1479444281722855571L;
	
	@Override
	public DruidPooledConnection getConnection(long maxWaitMillis) throws SQLException {
		long t=System.currentTimeMillis();
		try{
			return super.getConnection(maxWaitMillis);
		}finally{
			t=System.currentTimeMillis()-t;
			if(t>50)
				System.out.println("getConnection spend "+t+"ms");
		}
		
	}
	
	 public void setUrl(String jdbcUrl) {
		 this.jdbcUrl = jdbcUrl;
    }
}
